﻿@model Dal.Entities.DocCommon
@{
    Layout = null;
    ViewBag.Nav = 2;
    ViewBag.Menu = 0;
    ViewBag.PassAudit = (Model == null ? false : Model.StatusAudit == 1 ? true : false);
    ViewBag.HasQuestion = Web.Controllers.Common.HasQuestion((int)ViewBag.DocID, 0);
    int ti = 1;
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>病例录入</title>
    @Html.Partial("meta")
</head>
<body id="b_main">
    @Html.Partial("header")
    <!--/end #header-->
    <div id="wrapper">
        <!--holds pretty much everything-->
        @Html.Partial("menu")
        <!--/end #menu_main-->
        <div id="content">
            @Html.Partial("nav")
            @using (Html.BeginForm("editcommon", "doc", FormMethod.Post, new { @class = "broom_form", id = "form1", style = "margin-left: 30px;" }))
            {
                @Html.HiddenFor(i => i.DocID)
                if (ViewBag.Result != null)
                {
                    if (ViewBag.Result == true)
                    {
                <div class="notification confirm">
                    <em>
                        <img src="/assets/img/icons/tick_circle.png" alt="" />操作成功 </em>
                </div>
                    }
                }
                <table cellspacing="0" summary="table" class="broom_table" width="90%">
                    <tbody>
                        <tr class="@(ti % 2 == 1 ? "odd" : "even")">
                            <td>
                                @(ti++)
                            </td>
                            <td>
                                <span>入组日期</span> <span style="color: Red">*</span>
                            </td>
                            <td>
                                <div class="rili">
                                    @Html.TextBox("InputTime", Model != null && Model.InputTime.HasValue ? Model.InputTime.Value.ToString("yyyy-MM-dd") : null, new { @class = "inputbox date-pick", @readonly = "readonly" })
                                </div>
                            </td>
                            <td>
                                @Html.Raw(Web.Controllers.Common.GetQuestionDesc((int)ViewBag.DocID, "inputtime", 0, "入组日期"))
                            </td>
                        </tr>
                        @if (ViewBag.DocType == 2)
                        {
                            <tr class="@(ti % 2 == 1 ? "odd" : "even")">
                                <td>
                                    @(ti++)
                                </td>
                                <td>
                                    病例号
                                </td>
                                <td>
                                    @Html.TextBoxFor(i => i.MedicalNumber_2, new { @class = "inputbox" })
                                </td>
                                <td>
                                    @Html.Raw(Web.Controllers.Common.GetQuestionDesc((int)ViewBag.DocID, "MedicalNumber_2", 0, "病例号"))
                                </td>
                            </tr>
                        }
                        <tr class="@(ti % 2 == 1 ? "odd" : "even")">
                            <td>
                                @(ti++)
                            </td>
                            <td>
                                填表医生姓名 <span style="color: Red">*</span>
                            </td>
                            <td>
                                @Html.TextBoxFor(i => i.DoctorName, new { @class = "inputbox" })
                            </td>
                            <td>
                                @Html.Raw(Web.Controllers.Common.GetQuestionDesc((int)ViewBag.DocID, "DoctorName", 0, "填表医生姓名"))
                            </td>
                        </tr>
                        <tr class="@(ti % 2 == 1 ? "odd" : "even")">
                            <td>
                                @(ti++)
                            </td>
                            <td>
                                科别 <span style="color: Red">*</span>
                            </td>
                            <td>
                                @Html.RadioButtonFor(i => i.SubjectName, "内分泌", new { id = "subject1", onclick = "hide('SubjectName_Other')" })内分泌
                                <br />
                                @Html.RadioButtonFor(i => i.SubjectName, "其他", new { id = "subject2", onclick = "show('SubjectName_Other')" })其他
                                &nbsp;&nbsp; @Html.TextBoxFor(i => i.SubjectName_Other)
                                <script type="text/javascript">
                                    associate("subject2", "SubjectName_Other");
                                </script>
                            </td>
                            <td>
                                @Html.Raw(Web.Controllers.Common.GetQuestionDesc((int)ViewBag.DocID, "SubjectName", 0, "科别"))
                            </td>
                        </tr>
                        <tr class="@(ti % 2 == 1 ? "odd" : "even")">
                            <td>
                                @(ti++)
                            </td>
                            <td>
                                医生手机 <span style="color: Red">*</span>
                            </td>
                            <td>
                                @Html.TextBoxFor(i => i.DoctorMobile, new { @class = "inputbox" })
                            </td>
                            <td>
                                @Html.Raw(Web.Controllers.Common.GetQuestionDesc((int)ViewBag.DocID, "DoctorMobile", 0, "医生手机"))
                            </td>
                        </tr>
                        <tr class="@(ti % 2 == 1 ? "odd" : "even")">
                            <td>
                                @(ti++)
                            </td>
                            <td>
                                医院(全称) <span style="color: Red">*</span>
                            </td>
                            <td>
                                @Html.TextBoxFor(i => i.HospitalName, new { @class = "inputbox" })
                            </td>
                            <td>
                                @Html.Raw(Web.Controllers.Common.GetQuestionDesc((int)ViewBag.DocID, "HospitalName", 0, " 医院(全称)"))
                            </td>
                        </tr>
                    </tbody>
                </table>
                @Html.Partial("savebutton")
            }
            <!--/end .tabber-->
        </div>
    </div>
    <div class="clear">
    </div>
    @Html.Partial("questionScript")
    @if ((ViewBag.Status == "edit" || ViewBag.Status == "") && ViewBag.PassAudit == false)
    {
        <script type="text/javascript">
            $(document).ready(function () {
                $("#form1").validate({
                    rules: {
                        InputTime: { required: true },
                        SubjectName: { required: true },
                        DoctorName: { required: true, maxlength: 15 },
                        HospitalName: { required: true, maxlength: 30 },
                        DoctorMobile: { required: true, isPhone: true }
                    },
                    messages: {
                        InputTime: { required: "入组日期不能为空" },
                        SubjectName: { required: "科别为必填项" },
                        DoctorName: { required: "姓名不能为空", maxlength: "姓名太长" },
                        HospitalName: { required: "医院名称不能为空", maxlength: "名称太长" },
                        DoctorMobile: { required: "请填写联系电话", isPhone: "请正确填写电话号码" }
                    }
                });
                $("#InputTime").bind("change", function () {
                    $("#form1").validate().element("#InputTime");
                });
            });
        </script>
    }
</body>
</html>
